@@ -258,7 +258,7 @@ <h2>Basic activity with some additional detail</h2>
258
258
},
259
259
"object" : {
260
260
"@type": "urn:example:types:article",
261
- "@id": "urn:example:blog:abc123/xyz"
261
+ "@id": "urn:example:blog:abc123/xyz",
262
262
"url": "http://example.org/blog/2011/02/entry",
263
263
"displayName": "Why I love Activity Streams"
264
264
},
@@ -478,6 +478,78 @@ <h2><dfn title="NaturalLanguageValue">Natural Language Values</dfn></h2>
478
478
The associated values MUST be Strings.
479
479
</ p >
480
480
481
+ < section class ="informative ">
482
+ < h2 > Implementation Note</ h2 >
483
+
484
+ < p >
485
+ Implementers ought to note that, in [[JSON-LD]], establishment of a default
486
+ language requires the use of the < code > @language</ code > keyword inside the
487
+ JSON-LD < code > @context</ code > . For instance:
488
+ </ p >
489
+
490
+ < figure >
491
+ < figcaption > Using the < code > @language</ code > keyword:</ figcaption >
492
+ < pre class ="example highlight json "> {
493
+ "@context": {
494
+ "@language": "en"
495
+ },
496
+ "displayName": "This is the title"
497
+ }</ pre > </ figure >
498
+
499
+ < p > Using the < code > @language</ code > keyword in this manner establishes the
500
+ default language context for all string literal property values contained
501
+ by the object, including those that may not be intended as natural language
502
+ values. This current definition for < code > @language</ code > makes it difficult
503
+ for implementations that choose to ignore JSON-LD semantics when processing
504
+ Activity Streams documents or that wish to limit the language context only to
505
+ properties that are truly intended as natural language values. The < code > language</ code >
506
+ property introduced by the Activity Streams Vocabulary is provided to address
507
+ these shortcomings by allowing a default language to be established independently
508
+ of the JSON-LD < code > @context</ code > .</ p >
509
+
510
+ < figure >
511
+ < figcaption > Using the < code > language</ code > property has the same effect
512
+ as using the < code > @language</ code > inside the JSON-LD < code > @context</ code > :</ figcaption >
513
+ < pre class ="example highlight json "> {
514
+ "language": "en",
515
+ "displayName": "This is the title"
516
+ }</ pre > </ figure >
517
+
518
+ < p > However, use of < code > language</ code >
519
+ means that JSON-LD based implementations will need to take an additional
520
+ processing step to ensure that properties such as < code > title</ code > , < code > displayName</ code > ,
521
+ < code > summary</ code > and < code > content</ code > are handled properly.
522
+
523
+ < figure >
524
+ < figcaption > For instance, the following example JavaScript function extracts
525
+ the value of the < code > language</ code > property and injects it as an appropriate
526
+ JSON-LD < code > @language</ code > keyword into specific properties that are defined
527
+ as Natural Language Values to ensure that such properties are properly handled
528
+ by the standardized JSON-LD algorithms:</ figcaption >
529
+ < pre class ="example highlight javascript ">
530
+ function _fixdefaultlanguage(lang, obj) {
531
+ var __lang = obj['language'] || lang;
532
+ for (var n in obj) {
533
+ if (nlvs.indexOf(n) > -1) {
534
+ var vals = obj[n];
535
+ vals.forEach(function(val) {
536
+ val['@language'] = val['@language'] || __lang;
537
+ });
538
+ } else if (typeof obj[n] === 'object') {
539
+ var next = exp[n];
540
+ if (!Array.isArray(next))
541
+ next = [next];
542
+ next.forEach(
543
+ _fixdefaultlanguage.bind(
544
+ null,__lang));
545
+ }
546
+ }
547
+ }
548
+ </ pre >
549
+ </ figure >
550
+
551
+ </ section >
552
+
481
553
</ section >
482
554
483
555
< section id ="link ">
@@ -695,6 +767,27 @@ <h2><dfn title="Activity" id="activity">Activity</dfn></h2>
695
767
}
696
768
</ code > </ pre > </ figure >
697
769
770
+ < section class ="informative ">
771
+ < h2 > Implementation Note</ h2 >
772
+
773
+ < p >
774
+ Since Activity Streams 1.0, the < code > verb</ code > property has
775
+ been defined to permit identifiers either in the form of absolute IRI's
776
+ or simple < code > isegment-nz-nc</ code > tokens. For instance,
777
+ "< code > post</ code > " is a valid Activity Streams verb.
778
+ </ p >
779
+
780
+ < p >
781
+ However, existing JSON-LD processing algorithms have difficulty
782
+ processing such < code > isegment-nz-nc</ code > token values properly
783
+ without additional processing. It is RECOMMENDED that JSON-LD
784
+ implementations handle simple < code > isegment-nz-nc</ code > verbs
785
+ as "blank nodes". For instance, the value "< code > post</ code > " would
786
+ map to the blank node identified as < code > _:post</ code > .
787
+ </ p >
788
+
789
+ </ section >
790
+
698
791
< section id ="audienceTargeting ">
699
792
700
793
< h2 > Audience Targeting</ h2 >
@@ -887,6 +980,8 @@ <h2>Verbs and Object Types</h2>
887
980
888
981
< h2 > < dfn > Potential Actions</ dfn > </ h2 >
889
982
983
+ < p > < mark > Ed.Note: This section is currently provisional and may be moved to a separate document.</ mark > </ p >
984
+
890
985
< p >
891
986
All < code > Object</ code > instances can have an
892
987
< code > < a href ="activitystreams2-vocabulary.html#dfn-action "> action</ a > </ code > property
@@ -1108,6 +1203,14 @@ <h2>Handling of JSON-ID Compact IRIs</h2>
1108
1203
< td > < code > prov:</ code > </ td >
1109
1204
< td > < code > http://www.w3.org/ns/prov#</ code > </ td >
1110
1205
</ tr >
1206
+ < tr >
1207
+ < td > < code > geo:</ code > </ td >
1208
+ < td > < code > http://www.w3.org/2003/01/geo/wgs84_pos#</ code > </ td >
1209
+ </ tr >
1210
+ < tr >
1211
+ < td > < code > geos:</ code > </ td >
1212
+ < td > < code > http://www.opengis.net/ont/geosparql#</ code > </ td >
1213
+ </ tr >
1111
1214
</ table >
1112
1215
1113
1216
< p >
@@ -1264,7 +1367,7 @@ <h2>Acknowledgements</h2>
1264
1367
Chan, Michael Richardson, Michael Sullivan, Mike Macgirvin, Mislav
1265
1368
Marohnić, Mo Jangda, Monica Wilkinson, Nate Benes, NeilFred
1266
1369
Picciotto, Nick Howard, Nick Lothian, Nissan Dookeran, Nitya
1267
- Narasimhan, Pablo Martin, Padraic Brady, Pat G. Cappalaere , Patrick
1370
+ Narasimhan, Pablo Martin, Padraic Brady, Pat Cappelaere , Patrick
1268
1371
Aljord, Peter Ferne, Peter Reiser, Peter Saint-Andre, Phil Wolff,
1269
1372
Philip (flip) Kromer, Richard Cunningham, Richard Zhao, Rick
1270
1373
Severson, Robert Hall, Robert Langbert, Robert Dolin, Robin Cover,
0 commit comments